<?php
define("DEPLOYED",false);
require "global.php";
require "taobao.php";

include_once FANWE_ROOT.'sdks/taobao/TopClient.php';
include_once FANWE_ROOT.'sdks/taobao/request/ItemsSearchRequest.php';
include_once FANWE_ROOT.'sdks/taobao/request/TaobaokeItemsConvertRequest.php';
		
$c = new TopClient;
$c->appkey = APPKEY;
$c->secretKey = SECRET;

$gid = $_GET['gid'];

$item_req = new TaobaokeItemsDetailGetRequest;
$item_req->setFields("click_url");
$item_req->setPid(10135627);
$item_req->setNumIids($gid);
$item_resp = (array)$c->execute($item_req);
if($item_resp){
	//print_r($item_resp);
	$taoke_item_details = (array)$item_resp['taobaoke_item_details'];
	$taobaoke_item_detail = (array)$taoke_item_details['taobaoke_item_detail'];
	if($taobaoke_item_detail){
		$click_url = $taobaoke_item_detail['click_url'];
		echo "<a href='".$click_url."' target='_blank'>.点啊点</a>";
	}
}
?>